import {
  request
} from './request'

export function getRightsList() {
  return request({
    url: 'rights/list',
  })
}

export function removeRightById(roleid, rightId) {
  return request({
    url: `roles/${roleid}/rights/${rightId}`,
    method: 'delete'
  })
}

export function getRightsTree() {
  return request({
    url: 'rights/tree',
  })
}

export function allotRights(roleId, rids) {
  return request({
    url: `roles/${roleId}/rights`,
    method: 'post',
    data: {
      rids
    }
  })
}